#pragma once
#include "PropertiesWnd.h"
#include "MeasureStation.h"
#include "MeasureLine.h"
#include "ROIPane.h"


// CLineWnd

class CLineWnd : public CDockablePane
{
	DECLARE_DYNAMIC(CLineWnd)

public:
	CLineWnd();
	virtual ~CLineWnd();

  void AdjustLayout(void);
  void EnableAll(BOOL bEnable);

public:
  void SetVSDotNetLook(BOOL bSet)
  {
    m_wndPropList.SetVSDotNetLook(bSet);
    m_wndPropList.SetGroupNameFullWidth(bSet);
  }

public:
  void StationSwitch_slot(CMeasureStation* station);
  void LineAdded_slot(CMeasureLine *l);
  void LineDeleting_slot(CMeasureLine *l);
  void LineDeleted_slot(void);
  void ObjAdd_slot(const draw_obj* obj);
  void ObjDelete_slot(const draw_obj* obj);
  void ObjSelect_slot(const draw_obj* obj);
  void TemplateCSChanged_slot(void);

protected:
	DECLARE_MESSAGE_MAP()

protected:
  void InitPropList();
  void SetPropListFont();

protected:
  afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  afx_msg void OnSize(UINT nType, int cx, int cy);
  afx_msg void OnExpandAllProperties();
  afx_msg void OnUpdateExpandAllProperties(CCmdUI* pCmdUI);
  afx_msg void OnSortProperties();
  afx_msg void OnUpdateSortProperties(CCmdUI* pCmdUI);
  afx_msg void OnSetFocus(CWnd* pOldWnd);
  afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
  afx_msg LRESULT OnPropertyChanged(WPARAM wParam, LPARAM lParam);
  afx_msg void OnLineComboBoxSelChange();
  afx_msg void OnUpdateLineComboBox(CCmdUI* pCmdUI);
  afx_msg void OnLineROI();
  afx_msg void OnUpdateLineROI(CCmdUI* pCmdUI);
  afx_msg void OnEditROI();
  afx_msg void OnUpdateEditROI(CCmdUI* pCmdUI);
  afx_msg void OnLineAdd();
  afx_msg void OnUpdateLineAdd(CCmdUI* pCmdUI);
  afx_msg void OnLineDelete();
  afx_msg void OnUpdateLineDelete(CCmdUI* pCmdUI);
  afx_msg void OnLineCopy();
  afx_msg void OnUpdateLineCopy(CCmdUI* pCmdUI);
  afx_msg void OnLinePreview();
  afx_msg void OnUpdateLinePreview(CCmdUI* pCmdUI);
  afx_msg void OnLineSave();
  afx_msg void OnUpdateLineSave(CCmdUI* pCmdUI);
  afx_msg void OnLineFind();
  afx_msg void OnUpdateLineFind(CCmdUI* pCmdUI);

protected:
  CFont m_fntPropList;
  CComboBox m_wndCombo;
  CPropertiesToolBar m_wndToolBar;
  CMFCPropertyGridCtrl m_wndPropList;

public:
  CWnd*       ImageView;

private:
  CMeasureStation* station_;
  CMeasureLine* line_;
  boost::signals2::connection obj_delete_signal_connection_;

private:
  CMFCPropertyGridProperty* roi_;
  CMFCPropertyGridProperty* roi_x_;
  CMFCPropertyGridProperty* roi_y_;
  CMFCPropertyGridProperty* roi_width_;
  CMFCPropertyGridProperty* roi_height_;
  CMFCPropertyGridProperty* roi_angle_;

  CMFCPropertyGridProperty* edge_;
  CMFCPropertyGridProperty* edge_count_;
  CMFCPropertyGridProperty* edge_pairing_;
  CMFCPropertyGridProperty* edge_sigma_;
  CMFCPropertyGridProperty* edge_threshold_;
  CMFCPropertyGridProperty* edge_transition_;
  CMFCPropertyGridProperty* edge_select_;

  CMFCPropertyGridProperty* box_array_;
  CMFCPropertyGridProperty* box_array_size_;
  CMFCPropertyGridProperty* box_array_width_;

  CMFCPropertyGridProperty* fuzzy_;
  CMFCPropertyGridProperty* fuzzy_switch_;
  CMFCPropertyGridProperty* fuzzy_size_;
  CMFCPropertyGridProperty* fuzzy_threshold_;
  CMFCPropertyGridProperty* fuzzy_uncertainty_;
};


